// {
//   let ajax = function () {
//     console.log('start')
//
//     return new Promise(function (resolve ,reject) {
//       setTimeout(function () {
//         resolve()
//       },2000)
//     })
//   }
//
//   ajax().then(function () {
//     console.log('promise','resolve')
//   })
// }
//

{
  let ajax = function () {
    console.log('start')

    return new Promise(function (resolve, reject) {
      console.log('promise','resolve1')
      setTimeout(function () {
        resolve()
      }, 2000)
    })
  }

 
  ajax()
    .then(function () {
      console.log('promise','resolve2')
      return new Promise(function (resolve, reject) {
        setTimeout(function () {
          resolve()
        }, 3000)
      })
    })
    .then(function () {
      console.log('end')
    })
}